package com.ruoyi.back.service

import com.baomidou.mybatisplus.extension.plugins.pagination.Page
import com.baomidou.mybatisplus.extension.service.IService
import com.ruoyi.app.common.Data
import com.ruoyi.back.domain.UserMemberOrder
import com.ruoyi.back.domain.dto.UserMemberOrderDto
import com.ruoyi.back.domain.dto.UserMemberOrderSearchDto
import com.ruoyi.back.domain.vo.PayRecordVo
import com.ruoyi.back.domain.vo.UserMemberOrderDetailVo
import com.ruoyi.back.domain.vo.UserMemberOrderListVo
import com.ruoyi.back.enums.PayStatusEnum
import com.ruoyi.back.enums.PayTypeEnum
import com.ruoyi.common.core.page.PageDomain

interface UserMemberOrderService : IService<UserMemberOrder> {


    /**
     * 创建用户订单
     */
    fun createUserMemberOrder(userMemberOrderDto: UserMemberOrderDto): UserMemberOrder

    /**
     * 支付记录列表
     */
    fun payRecordList(userId: Long, pageDomain: PageDomain): Page<PayRecordVo>


    /**
     * 通过订单号获取订单
     */
    fun getUserMemberOrderByOrderNum(orderNum: String): UserMemberOrder?

    /**
     * 用户会员订单列表
     */
    fun userMemberOrderPage(userMemberOrderSearchDto: UserMemberOrderSearchDto): Page<UserMemberOrderListVo>

    /**
     * 用户订单详情
     */
    fun userMemberOrderDetail(orderId: Long): Data<UserMemberOrderDetailVo>


    /**
     * 移除会员订单
     */
    fun removeMemberOrder(orderId: Long): Data<Boolean>

    /**
     * 更新订单支付状态
     */
    fun updateMemberPayStatus(orderNum: String, payTypeEnum: PayTypeEnum)

    /**
     * 获取用户最新的订单名称
     */
    fun getUserLastOrderName(userId: Long): String?
}